<html>
<body>
<div>\\a</div>
<script>
    var a = new RegExp('\\badf\\b');
</script>
</body>
</html>